//@author A0105495A
#include "stdafx.h"
#include "CppUnitTest.h"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace UnitTest1
{		
	TEST_CLASS(UnitTest1)
	{
	public:
		
		TEST_METHOD(TestShowAdded)
		{
			OutputDisplay::get().showAdded ("meet friend");
			string stringActual = OutputDisplay::get().getUpcomingText();
			string stringExpected = "'meet friend' added successfully\r\n";
			Assert::AreEqual(stringExpected, stringActual);
		}

		TEST_METHOD(displayError)
		{
			OutputDisplay::get().displayError(IllegalInput::ADD_TOO_MANY_PARAMETERS);
			string stringActual = OutputDisplay::get().getUpcomingText();
			string stringExpected = "Error: Too many parameters for the add keyword.\r\n";
			Assert::AreEqual(stringExpected, stringActual);
		}

		TEST_METHOD(getShouldClearUpComing)
		{
			bool statusActual = OutputDisplay::get().getShouldClearUpComing();;
			bool statusExpected = false;
			Assert::AreEqual(statusActual, statusExpected);
		}

		TEST_METHOD(availableDue)
		{
			OutputDisplay::get().setAvailableDue (false);
			bool availableActual=OutputDisplay::get().availableDue() ;
			bool availableExpected = false;
			Assert::AreEqual(availableActual, availableExpected);
		}

		TEST_METHOD(showUndoneSuccess)
		{
			OutputDisplay::get().showUndoneSuccess(3);
			string stringActual = OutputDisplay::get().getUpcomingText();
			string stringExpected = "3 steps undo successful\r\n";
			Assert::AreEqual(stringExpected, stringActual);
		}

	};
}